Skip to main content

Website deployment

Website Extraction

  • First you have to extract the snapta.zip then you will get zip files.

    • snapta_web.zip
  • Create snapta_web folder with below command

     mkdir -p /var/www/snapta_web
  • Upload snapta_web.zip to a location where you want to deploy Project using FileZilla

    • /var/www/snapta_web (This is the recommended location)
  • Extract snapta_web.zip to /var/www/snapta_web

  • Here you will get all the files of website.

Configure Environment Variables

  • Edit the .env file in the root directory of your project. This step is mandatory to ensure the application can connect to your server.

  • Update the following lines in the .env file with your actual server and database credentials:

    NEXT_PUBLIC_API_URL=http://server_ip/api
    NEXT_PUBLIC_SOCKET_URL=http://server_ip:3002/

Server Starting

  • After editing the .env file, you have to create build of website.
  • Every time you change the code you have to create build of website and restart the server.
  npm run build
  • After that you have start the server on port 3005.
  PORT=3005 pm2 start npm --name "snapta_web" -- run start
  • If you want to stop the server then use below command.
  pm2 stop snapta_web
  • If you want to restart the server then use below command.
  pm2 restart snapta_web
  • you have to open your browser and go to http://server_ip:3005 to see the website.